import requests
import re
from bs4 import BeautifulSoup

url = 'https://movie.douban.com/top250'
headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36'
}

response = requests.get(url, headers=headers)
print(response.status_code)
print(response.text)

text = re.findall(r'<title>(.*?)</title>', response.text, re.DOTALL)